\(\int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx\) [91]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F(-1)]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 42, antiderivative size = 178 \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}+\frac {6 a c g \sqrt {\cos (e+f x)} \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{5 f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}-\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}} \]

[Out]

2/5*a*c*(g*cos(f*x+e))^(5/2)/f/g/(a+a*sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))^(1/2)+6/5*a*c*g*(cos(1/2*f*x+1/2*e)^2
)^(1/2)/cos(1/2*f*x+1/2*e)*EllipticE(sin(1/2*f*x+1/2*e),2^(1/2))*cos(f*x+e)^(1/2)*(g*cos(f*x+e))^(1/2)/f/(a+a*
sin(f*x+e))^(1/2)/(c-c*sin(f*x+e))^(1/2)-2/5*a*(g*cos(f*x+e))^(5/2)*(c-c*sin(f*x+e))^(1/2)/f/g/(a+a*sin(f*x+e)
)^(1/2)

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2930, 2921, 2721, 2719} \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=-\frac {2 a \sqrt {c-c \sin (e+f x)} (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a \sin (e+f x)+a}}+\frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a \sin (e+f x)+a} \sqrt {c-c \sin (e+f x)}}+\frac {6 a c g \sqrt {\cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right ) \sqrt {g \cos (e+f x)}}{5 f \sqrt {a \sin (e+f x)+a} \sqrt {c-c \sin (e+f x)}} \]

[In]

Int[(g*Cos[e + f*x])^(3/2)*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]],x]

[Out]

(2*a*c*(g*Cos[e + f*x])^(5/2))/(5*f*g*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]]) + (6*a*c*g*Sqrt[Cos[e
 + f*x]]*Sqrt[g*Cos[e + f*x]]*EllipticE[(e + f*x)/2, 2])/(5*f*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]
]) - (2*a*(g*Cos[e + f*x])^(5/2)*Sqrt[c - c*Sin[e + f*x]])/(5*f*g*Sqrt[a + a*Sin[e + f*x]])

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 2721

Int[((b_)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[(b*Sin[c + d*x])^n/Sin[c + d*x]^n, Int[Sin[c + d*x]
^n, x], x] /; FreeQ[{b, c, d}, x] && LtQ[-1, n, 1] && IntegerQ[2*n]

Rule 2921

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)/(Sqrt[(a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]]*Sqrt[(c_) + (d_.)*sin[(e_
.) + (f_.)*(x_)]]), x_Symbol] :> Dist[g*(Cos[e + f*x]/(Sqrt[a + b*Sin[e + f*x]]*Sqrt[c + d*Sin[e + f*x]])), In
t[(g*Cos[e + f*x])^(p - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2
, 0]

Rule 2930

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) +
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*(g*Cos[e + f*x])^(p + 1)*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e
 + f*x])^n/(f*g*(m + n + p))), x] + Dist[a*((2*m + p - 1)/(m + n + p)), Int[(g*Cos[e + f*x])^p*(a + b*Sin[e +
f*x])^(m - 1)*(c + d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && EqQ[b*c + a*d, 0] &&
EqQ[a^2 - b^2, 0] && GtQ[m, 0] && NeQ[m + n + p, 0] &&  !LtQ[0, n, m] && IntegersQ[2*m, 2*n, 2*p]

Rubi steps \begin{align*} \text {integral}& = -\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}}+\frac {1}{5} (3 a) \int \frac {(g \cos (e+f x))^{3/2} \sqrt {c-c \sin (e+f x)}}{\sqrt {a+a \sin (e+f x)}} \, dx \\ & = \frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}-\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}}+\frac {1}{5} (3 a c) \int \frac {(g \cos (e+f x))^{3/2}}{\sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \, dx \\ & = \frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}-\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}}+\frac {(3 a c g \cos (e+f x)) \int \sqrt {g \cos (e+f x)} \, dx}{5 \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ & = \frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}-\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}}+\frac {\left (3 a c g \sqrt {\cos (e+f x)} \sqrt {g \cos (e+f x)}\right ) \int \sqrt {\cos (e+f x)} \, dx}{5 \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}} \\ & = \frac {2 a c (g \cos (e+f x))^{5/2}}{5 f g \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}+\frac {6 a c g \sqrt {\cos (e+f x)} \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{5 f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}-\frac {2 a (g \cos (e+f x))^{5/2} \sqrt {c-c \sin (e+f x)}}{5 f g \sqrt {a+a \sin (e+f x)}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 3.48 (sec) , antiderivative size = 170, normalized size of antiderivative = 0.96 \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\frac {(g \cos (e+f x))^{3/2} \sec ^3(e+f x) \sqrt {a (1+\sin (e+f x))} \sqrt {c-c \sin (e+f x)} \left (3 (3 \cos (e-f x-\arctan (\tan (e)))+\cos (e+f x+\arctan (\tan (e)))) \cot (e) \sqrt {\sec ^2(e)}+2 \cos (e+f x) (-6 \cot (e)+\sin (2 (e+f x)))-6 \cos (e) \csc (f x+\arctan (\tan (e))) \, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2(f x+\arctan (\tan (e)))\right ) \sqrt {\sec ^2(e)} \sqrt {\sin ^2(f x+\arctan (\tan (e)))}\right )}{10 f} \]

[In]

Integrate[(g*Cos[e + f*x])^(3/2)*Sqrt[a + a*Sin[e + f*x]]*Sqrt[c - c*Sin[e + f*x]],x]

[Out]

((g*Cos[e + f*x])^(3/2)*Sec[e + f*x]^3*Sqrt[a*(1 + Sin[e + f*x])]*Sqrt[c - c*Sin[e + f*x]]*(3*(3*Cos[e - f*x -
 ArcTan[Tan[e]]] + Cos[e + f*x + ArcTan[Tan[e]]])*Cot[e]*Sqrt[Sec[e]^2] + 2*Cos[e + f*x]*(-6*Cot[e] + Sin[2*(e
 + f*x)]) - 6*Cos[e]*Csc[f*x + ArcTan[Tan[e]]]*HypergeometricPFQ[{-1/2, -1/4}, {3/4}, Cos[f*x + ArcTan[Tan[e]]
]^2]*Sqrt[Sec[e]^2]*Sqrt[Sin[f*x + ArcTan[Tan[e]]]^2]))/(10*f)

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 1.67 (sec) , antiderivative size = 438, normalized size of antiderivative = 2.46

method result size
default \(\frac {2 \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {g \cos \left (f x +e \right )}\, g \left (3 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, E\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right )-3 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right )+6 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, E\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sec \left (f x +e \right )-6 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \sec \left (f x +e \right )+3 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, E\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \left (\sec ^{2}\left (f x +e \right )\right )-3 i \sqrt {\frac {\cos \left (f x +e \right )}{1+\cos \left (f x +e \right )}}\, \sqrt {\frac {1}{1+\cos \left (f x +e \right )}}\, F\left (i \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right ), i\right ) \left (\sec ^{2}\left (f x +e \right )\right )+\cos \left (f x +e \right ) \sin \left (f x +e \right )+\sin \left (f x +e \right )+3 \tan \left (f x +e \right )\right )}{5 f \left (1+\cos \left (f x +e \right )\right )}\) \(438\)

[In]

int((g*cos(f*x+e))^(3/2)*(a+a*sin(f*x+e))^(1/2)*(c-c*sin(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2/5/f*(-c*(sin(f*x+e)-1))^(1/2)*(a*(1+sin(f*x+e)))^(1/2)*(g*cos(f*x+e))^(1/2)*g/(1+cos(f*x+e))*(3*I*(1/(1+cos(
f*x+e)))^(1/2)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticE(I*(csc(f*x+e)-cot(f*x+e)),I)-3*I*(1/(1+cos(f*x+e)))
^(1/2)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)+6*I*(1/(1+cos(f*x+e)))^(1/2)*(
cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticE(I*(csc(f*x+e)-cot(f*x+e)),I)*sec(f*x+e)-6*I*(1/(1+cos(f*x+e)))^(1/2
)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*sec(f*x+e)+3*I*(1/(1+cos(f*x+e)))^(
1/2)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticE(I*(csc(f*x+e)-cot(f*x+e)),I)*sec(f*x+e)^2-3*I*(1/(1+cos(f*x+e
)))^(1/2)*(cos(f*x+e)/(1+cos(f*x+e)))^(1/2)*EllipticF(I*(csc(f*x+e)-cot(f*x+e)),I)*sec(f*x+e)^2+cos(f*x+e)*sin
(f*x+e)+sin(f*x+e)+3*tan(f*x+e))

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.10 (sec) , antiderivative size = 116, normalized size of antiderivative = 0.65 \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\frac {2 \, \sqrt {g \cos \left (f x + e\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} g \sin \left (f x + e\right ) - 3 i \, \sqrt {2} \sqrt {a c g} g {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right )\right ) + 3 i \, \sqrt {2} \sqrt {a c g} g {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, \cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right )\right )}{5 \, f} \]

[In]

integrate((g*cos(f*x+e))^(3/2)*(a+a*sin(f*x+e))^(1/2)*(c-c*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/5*(2*sqrt(g*cos(f*x + e))*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c)*g*sin(f*x + e) - 3*I*sqrt(2)*sq
rt(a*c*g)*g*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(f*x + e) + I*sin(f*x + e))) + 3*I*sqrt(2)*sq
rt(a*c*g)*g*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, cos(f*x + e) - I*sin(f*x + e))))/f

Sympy [F(-1)]

Timed out. \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\text {Timed out} \]

[In]

integrate((g*cos(f*x+e))**(3/2)*(a+a*sin(f*x+e))**(1/2)*(c-c*sin(f*x+e))**(1/2),x)

[Out]

Timed out

Maxima [F]

\[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\int { \left (g \cos \left (f x + e\right )\right )^{\frac {3}{2}} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} \,d x } \]

[In]

integrate((g*cos(f*x+e))^(3/2)*(a+a*sin(f*x+e))^(1/2)*(c-c*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate((g*cos(f*x + e))^(3/2)*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c), x)

Giac [F]

\[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\int { \left (g \cos \left (f x + e\right )\right )^{\frac {3}{2}} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {-c \sin \left (f x + e\right ) + c} \,d x } \]

[In]

integrate((g*cos(f*x+e))^(3/2)*(a+a*sin(f*x+e))^(1/2)*(c-c*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate((g*cos(f*x + e))^(3/2)*sqrt(a*sin(f*x + e) + a)*sqrt(-c*sin(f*x + e) + c), x)

Mupad [F(-1)]

Timed out. \[ \int (g \cos (e+f x))^{3/2} \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx=\int {\left (g\,\cos \left (e+f\,x\right )\right )}^{3/2}\,\sqrt {a+a\,\sin \left (e+f\,x\right )}\,\sqrt {c-c\,\sin \left (e+f\,x\right )} \,d x \]

[In]

int((g*cos(e + f*x))^(3/2)*(a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))^(1/2),x)

[Out]

int((g*cos(e + f*x))^(3/2)*(a + a*sin(e + f*x))^(1/2)*(c - c*sin(e + f*x))^(1/2), x)